unit SettingsUnit;

interface

uses Inifiles, SysUtils, Forms;

type
  ArrOfStr = array of string;

  procedure SettingsInit;
  function SettingsGetValue(Section,Param:string):string;
  procedure SettingsSaveValue(Section,Param,Value:string);
  function explodeString(sPart, sInput: string): ArrOfStr;


var
    Inifile:TIniFile;
implementation

function ExplodeString(sPart, sInput: string): ArrOfStr;
 begin
   while Pos(sPart, sInput) <> 0 do
    begin
     SetLength(Result, Length(Result) + 1);
     Result[Length(Result) - 1] := Copy(sInput, 0,Pos(sPart, sInput) - 1);
     Delete(sInput, 1,Pos(sPart, sInput));
   end;
   SetLength(Result, Length(Result) + 1);
   Result[Length(Result) - 1] := sInput;
 end;

procedure Settingsinit;
begin

//  Inifile.FileName := 'shell.ini';
end;

function SettingsGetValue(Section,Param:string):string;
begin
  Inifile := TIniFile.Create(ExtractFilePath(Application.ExeName)+'shell.ini');
//  Inifile.FileName
  Result:=Inifile.ReadString(Section,Param,'N/A');
  Inifile.Destroy;
end;

procedure SettingsSaveValue(Section,Param,Value:string);
begin
  Inifile := TIniFile.Create(ExtractFilePath(Application.ExeName)+'shell.ini');
  Inifile.WriteString(Section,Param,Value);
//  Inifile.Destroy;
end;


end.
